package com.ruibang.glass.material.controller.cl;

import com.ruibang.glass.material.domain.req.ycl.ManageOutBoundReq;
import com.ruibang.glass.material.domain.req.ycl.ManageOutInReq;
import com.ruibang.glass.material.entity.cl.MaterialCLOutboundManagement;
import com.ruibang.glass.material.service.cl.GMaterialCLOutboundManagementService;
import com.teaming.cloud.framework2.common.model.ResultBody;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 材料出库管理 前端控制器
 * </p>
 *
 * @author mameng
 * @since 2024-02-05
 */
@RestController

@RequestMapping("/api/material/cl/out/bound/manage")
@Api(value="材料出库管理",tags={"材料出库"})
public class MaterialCLOutBoundController {

    @Autowired
    private GMaterialCLOutboundManagementService materialOutboundManagementService;


    @PostMapping("/list")
    @ApiOperation(value = "材料入库管理列表", response = ResultBody.class)
    public ResultBody getPageList(@RequestBody ManageOutBoundReq materialManagementReq) {
        return ResultBody.success(materialOutboundManagementService.getPage(materialManagementReq));
    }

    @PostMapping("/update")
    @ApiOperation(value = "更新", response = ResultBody.class)
    public ResultBody updateById(@RequestBody MaterialCLOutboundManagement materialManagement) {
        return ResultBody.success(materialOutboundManagementService.updateById(materialManagement));
    }

    @GetMapping("/getOne/{id}")
    @ApiOperation(value = "更新", response = ResultBody.class)
    public ResultBody getOneById(@PathVariable("id") String id) {
        return ResultBody.success(materialOutboundManagementService.getById(id));
    }

    @PostMapping("/getBondList")
    @ApiOperation(value = "出入库流水列表", response = ResultBody.class)
    public ResultBody getBondList(@RequestBody ManageOutInReq manageOutInReq) {
        return ResultBody.success(materialOutboundManagementService.getPage(manageOutInReq));
    }






}
